/*
 * @Description: 
 * @Version: 
 * @Company: 杭州凯立通信有限公司
 * @Author: Jesen
 * @Date: 2018-11-23 10:06:52
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2018-11-26 10:17:46
 */
// 需要权限访问的完整路由表
// 获取权限后和该表匹配的则被加入到正式路由中。该表必须完整的包含工程页面
// path 页面跳转地址
// permission字段内容从后台获取，代表该页内部详细权限，以key:value形式存储

// {
//     path: 路由地址,
//     如果想打包成指定的文件名
//     component: r => require.ensure([], () => r(require('路由页面')), '打包后的文件名'),
//     或者采用下面这种方式打包生成随机文件名
//     component: resolve => require(['路由页面'], resolve),
// }

const asyncRouter = [{
        path: '/asyncRouter',
        component: r => require.ensure([], () => r(require('../components/common/Home')), 'asyncRouter'),
        children: []
    },
    {
        path: '/icon',
        meta: {
            title: '自定义图标',
            permission: []
        },
        component: r => require.ensure([], () => r(require('../components/page/Icon')), 'icon'),
    },
    {
        path: '/table',
        meta: {
            title: '基础表格',
            permission: []
        },
        component: r => require.ensure([], () => r(require('../components/page/BaseTable')), 'table'),
    },
    {
        path: '/tabs',
        meta: {
            title: 'tab选项卡',
            permission: []
        },
        component: r => require.ensure([], () => r(require('../components/page/Tabs')), 'tabs')
    },
    {
        path: '/form',
        meta: {
            title: '基本表单',
            permission: []
        },
        component: r => require.ensure([], () => r(require('../components/page/BaseForm')), 'form')
    },
    {
        // 富文本编辑器组件
        path: '/editor',
        meta: {
            title: '富文本编辑器',
            permission: []
        },
        component: r => require.ensure([], () => r(require('../components/page/VueEditor')), 'editor')
    },
    {
        // markdown组件
        path: '/markdown',
        meta: {
            title: 'markdown编辑器',
            permission: []
        },
        component: r => require.ensure([], () => r(require('../components/page/Markdown')), 'markdown')
    },
    {
        // 图片上传组件
        path: '/upload',
        meta: {
            title: '文件上传',
            permission: []
        },
        component: r => require.ensure([], () => r(require('../components/page/Upload')), 'upload')
    },
    {
        // vue-schart组件
        path: '/charts',
        meta: {
            title: 'schart图表',
            permission: []
        },
        component: r => require.ensure([], () => r(require('../components/page/BaseCharts')), 'charts')
    },
    {
        // 拖拽列表组件
        path: '/drag',
        meta: {
            title: '拖拽列表',
            permission: []
        },
        component: r => require.ensure([], () => r(require('../components/page/DragList')), 'drag')
    },
    {
        // 权限页面
        path: '/permission',
        meta: { title: '权限测试', permission: [] },
        component: r => require.ensure([], () => r(require('../components/page/Permission')), 'permission')
    },
]




export default asyncRouter